import axios from '@/utils/request';

/**
 * 查询微信客户信息
 * @params 查询条件
 */
 export async function QueryCustomerWebChartByCondition(params) {
    const res = await axios.post('/CustomerWebChart/QueryCustomerByCondition',params);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
/**
 * 根据微信Id查询客户信息
 * @id 媒体Id
 */
export async function QueryWebChartCustomerByOpenId(openid) {
    const res = await axios.get('/CustomerWebChart/QueryWebChartCustomerByOpenId?openid='+openid);
    if (res.data.code === 200) {
        return res.data.data;
    }
    return Promise.reject(new Error(res.data.msg));
}
/**
 * 根据openId删除微信客户信息
 */
 export async function DeleteCustomer(id) {
    const res = await axios.post('/CustomerWebChart/DeleteCustomer?openid='+id);
    if (res.data.code === 200) {
        return res.data.msg;
    }
    return Promise.reject(new Error(res.data.msg));
}

